package com.ficus.road.maintain.core.infrastructure.mongo.converter;

import org.bson.types.ObjectId;
import org.springframework.core.convert.converter.Converter;
import org.springframework.data.convert.WritingConverter;

/**
 * ObjectId转化类
 * <p>
 * 为什么要有这个类: 因为默认的MongoMapping不支持ObjectId一刚
 */
@WritingConverter
public class ObjectIdConverter implements Converter<ObjectId, Object> {
    @Override
    public Object convert(ObjectId objectId) {
        return objectId;
    }
}